Skip to content

Scopes filtering to jar added in the spring boot jar #590

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed

Scopes filtering to jar added in the spring boot jar #590

wants to merge 3 commits into from

Conversation

olamy
Copy link
Contributor

@olamy olamy commented Mar 27, 2014

I'd like to filter the jar included in the spring boot one based on the scope.

            <configuration>
              <scopes>
                <scope>compile</scope>
                <scope>runtime</scope>
              </scopes>
            </configuration>

olamy added 2 commits March 27, 2014 11:28
My use case: a module generate a spring-boot jar which is zipped in an assembly with a javaagent but as the javaagent is declared as a dependency it's included in the spring boot jar which I don't want
@philwebb
Copy link
Member

Thanks, have you signed the contributors agreement?

@philwebb
Copy link
Member

See also #413

@olamy
Copy link
Contributor Author

olamy commented Mar 27, 2014

I don't remember for the cla. I probably did that long time ago for other projects.
yup handling optional is a good idea too.

@snicoll
Copy link
Member

snicoll commented Mar 27, 2014

There is a System.out.println in the constructor that should go away.

@olamy
Copy link
Contributor Author

olamy commented Mar 27, 2014

my bad just fixed that

@philwebb philwebb added this to the 1.1.0.RELEASE milestone Mar 27, 2014
@olamy
Copy link
Contributor Author

olamy commented Mar 27, 2014

do not need that. I will use an other module to make my distrib this will ease my use case.

@olamy olamy closed this Mar 27, 2014
@snicoll
Copy link
Member

snicoll commented Mar 27, 2014

For the record, I discussed this with Olivier and recommended an exclude approach instead. He wants to exclude one particular dependency that he has flagged as provided and does not use the embedded container. If one uses a regular web application, this wouldn't help him much as the container wouldn't be included either.

There are a few ways to exclude dependencies, the maven-dependency-plugin has a few nice options we could consider

@philwebb philwebb removed this from the 1.1.0.RELEASE milestone Mar 28, 2014
@gordon00
Copy link

Too bad, it would have been useful in GWT context.
When you use GWT, you have to add GWT dependencies that are needed only by the maven-gwt-plugin to procuce some javascript files. (They have to be project dependencies, not plugin dependencies)
In classic maven war project , you just set provided scope to few "root" gwt dependencies and that's it.
Here, you have to browse all gwt dependency branch to add them into "excludes" xml element. So boring... that does not match maven provided scope spirit... don't you agree ?

@philwebb
Copy link
Member

@gordon00 This issue has been closed for over a year, please raise a new request if you think things can be improved.

We need to include provided scope dependencies to make fully executable wars. If you're happy deploying to tomcat you could just set skip to true on spring-boot:repackage. You can also use the excludeGroupIds property if all the GWT artifacts have a common group.

Also please don't cross-post comments. I'm going to delete the same comment that you added to #413.

@gordon00
Copy link

No, I really want to use the plugin to generate a standalone jar including tomcat.
Google gin, google guice, google guava for gwt don't have the same groupId... And there's a lot of others GWT libs like gwt-dispatch...
Example : gin include guice. But gin and guice-assist don't have same groupId. (thanks google)
If I exclude parent dependency gin, guice-assist and others sublibs are still included in jar.
Would you think it is possible to exclude a dependency and all his subdependencies transitively ?
The config would look like this :

<excludes>
  <eclude>
    <groupId>com.google.gwt.inject</groupId>
    <artifactId>gin</artifactId>
    <excludeTransitively>true</excludeTransitively>
</excludes>

@philwebb
Copy link
Member

@gordon00 This is just adding noise to the closed issue. Please open a new one. Use three backticks to escape XML .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants